package com.galen.manual.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Min;
import javax.validation.constraints.Max;

@Data
@Schema(description = "订单明细创建请求")
public class OrderItemCreateDTO {

    @NotNull(message = "商品ID不能为空")
    @Schema(description = "商品ID", required = true)
    private Long productId;

    @NotNull(message = "购买数量不能为空")
    @Min(value = 1, message = "购买数量必须大于0")
    @Max(value = 999, message = "购买数量不能超过999")
    @Schema(description = "购买数量", required = true)
    private Integer quantity;

    @Schema(description = "备注")
    private String remark;
}